using System;
using System.Collections.Generic;
using System.Text;

namespace Slobby.Server {
    public class ClientList {

        List<Client> list = new List<Client>();

        public void DisconnectAll(string reason) {

        }

        public void SendToAll(object msg) {
            lock (list) {
                foreach (Client c in list) {
                    c.SendMessage(msg);
                }
            }
        }

        public void SendToAllExcept(Client notrecieve, object msg) {
            lock (list) {
                foreach (Client c in list) {
                    if (!object.ReferenceEquals(c, notrecieve))
                        c.SendMessage(msg);
                }
            }
        }

        public void Add(Client client) {
            lock (list) {
                list.Add(client);
            }
        }
    }
}
